<template>
    <div class="box">
        <h3>组合式API代码中调用vue实例对象</h3>
        <ul>
            <li>通过 import { getCurrentInstance } from "vue"; 加载getCurrentInstance 方法</li>
            <li>getCurrentInstance 只能在组合式api中被直接调用，返回vue监控实例对象</li>
            <li>在需要实例对象的区域通过 getCurrentInstance 返回的对象调用 proxy 属性，加载vue实例</li>
        </ul>
        <input type="button" value="发送实例" @click="printthis()">

    </div>
</template>
<script setup>
import { getCurrentInstance } from 'vue'
const ins = getCurrentInstance()
// const {proxy}=getCurrentInstance()
const printthis = function () {
    console.log('printthis', ins.proxy);

    console.log('printthis', ins.proxy.$options);
    // console.log(proxy);



}


</script>
<style scoped lang="sass"></style>